/*
    Copyright (C) 2025 mio <stigma@disroot.org>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef ASTER_ASTER_H
#define ASTER_ASTER_H

#include <tqstringlist.h>
#include <tqwidget.h>
#include <tdemainwindow.h>

#include "aster_controlbar.h"
#include "aster_videoplayer.h"

class Playlist;
class TDEPopupMenu;

class Aster : public TDEMainWindow
{
    TQ_OBJECT

public:
    Aster(TQWidget *parent = nullptr, const char *name = nullptr);
    ~Aster();

    void playBD();
    void playDVD();

signals:
    void open(const KURL &url);

public slots:
    void enqueFile(const KURL &path);

protected:
    Playlist *m_playlist;
    ControlBar *m_controlBar;
    VideoPlayer *m_player;
    TDEPopupMenu *m_audioTrackMenu;
    TDEPopupMenu *m_subtitleTrackMenu;
    TDEPopupMenu *m_videoTrackMenu;

    void mouseMoveEvent(TQMouseEvent *) override;
    void timerEvent(TQTimerEvent *) override;

    void setupActions();

protected slots:
    void slotConfigureShortcuts();
    void slotForward();
    void slotForward1(); // 1 minute
    void slotFullScreen();
    void slotOpen();
    void slotRewind();
    void slotRewind1(); // 1 minute
    void slotSetAudioTrack(int id);
    void slotSetSubtitleTrack(int id);
    void slotSetVideoTrack(int id);
    void slotShowMenubar();
    void slotUpdateTracks();

private:
    int m_controlTimer;
};

#endif
